<!DOCTYPE html>
<html>
<head>
	<title>案例1</title>
</head>
<body>
<script type="text/javascript">
	
	let str = 'acdadreajakaa';
	let index;
	do {
		index = str.indexOf('a', index + 1);
		if(index >= 0) {
			str = str.replace('a', 'A');
		}
	} while(index >= 0)
	console.log(str)

</script>
</body>
</html>